//
// Created by Administrator on 2023/2/10.
//

#include "driver/i2c.h"
#include "../../main/usercfg.h"


void common_iic_init(void)
{
    i2c_config_t conf = {
            .mode = I2C_MODE_MASTER,
            .sda_io_num = common_sda,
            .scl_io_num = common_scl,
            .sda_pullup_en = GPIO_PULLUP_ENABLE,
            .scl_pullup_en = GPIO_PULLUP_ENABLE,
            .master.clk_speed = common_i2c_freq,
            // .clk_flags = 0,
    };
    i2c_param_config(common_i2c_num, &conf);
    i2c_driver_install(common_i2c_num, I2C_MODE_MASTER,0,0,0);
}